<?php
$this->menu = array(
  
    array('label' => Yii::t('app', 'Manage') . ' ' . $model->label(), 'url' => array('admin')),
);
?>
<h3><?php echo Yii::t('app', 'Manage Promotion Coupon'); ?></h3>

<script type="text/javascript">
    function ChangeStatus(id, status)
    {
        $.ajax({
            url: "<?php echo $statuschangeurl; ?>",
            type: "post",
            data: "id=" + id + "&status=" + status,
            dataType: "html",
            success: function(msg) {
                $('#coupons-grid').yiiGridView.update('coupons-grid');
            }
        });

    }

</script>

<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'coupons-grid',
    'dataProvider' => $DataProvider,
    'filter' => $model,
    'columns' => array(
        // 'id',
        'name',
        'inprice',
        'inpercentage',
        'apply_discount_to',
        array(
            'name' => 'status',
            'type' => 'raw',
            'value' => 'changeStatusIngridView($data)',
            'filter' => array('0' => Yii::t('app', 'Inactive'), '1' => Yii::t('app', 'Active')),
        ),
        /* 'restrict_by_date', */
        /*
          'valid_from_date',
          'valid_to_date',
          'maximum_number_of_redemptions_per_code',
          'maximum_number_of_redemptions_per_user',
          'maximum_number_of_prodcuts_to_discount',
          'class_restriction',
          'course_restriction',
          'category_restriction',
          'user_restriction',
          'status',
          'created',
         */
      
    ),
));
?>